package
{
	import com.xcopy.Screen;
	import flash.display.MovieClip;
	import flash.events.MouseEvent;

	public class Slot25Rule extends Screen
	{
		private var _table:Slot25Table;

		public function get table():Slot25Table
		{
			return _table;
		}

		public function Slot25Rule(r:* = null)
		{
			super(r);
			_table = r as Slot25Table;
		}

		override public function set clip(mc:MovieClip):void
		{
			super.clip = mc;
			setClickEvent(clip.btnSite, onSite);
			setClickEvent(clip.btnClose, onClose);
			setClickEvent(clip.btnRate, onRate);
			setClickEvent(clip.btnManual, onManual);
			onClose();
		}

		public function onSite(e:MouseEvent = null):void
		{
			this.table.playSound('1020');
			openURL('http://golden.goldengame.com.tw/intro/intro_game.php?x=3&y=7');
		}

		public function onClose(e:MouseEvent = null):void
		{
			this.table.playSound('1020');
			disable();
		}

		public function openRate(e:MouseEvent = null):void
		{
			this.table.playSound('1010');
			clip.gotoAndStop('Rate');
			clip.btnRate.visible = false;
			clip.btnManual.visible = true;
			enable();
		}

		public function onRate(e:MouseEvent = null):void
		{
			this.table.playSound('1020');
			clip.gotoAndStop('Rate');
			clip.btnRate.visible = false;
			clip.btnManual.visible = true;
			enable();
		}

		public function onManual(e:MouseEvent = null):void
		{
			this.table.playSound('1020');
			clip.gotoAndStop('Rule');
			clip.btnRate.visible = true;
			clip.btnManual.visible = false;
			enable();
		}
	}
}
